3.72 \(\int \frac {(2-x-2 x^2+x^3) (d+e x+f x^2+g x^3+h x^4+i x^5)}{4-5 x^2+x^4} \, dx\)

Optimal. Leaf size=92 \[ \log (x+2) (d-2 e+4 f-8 g+16 h-32 i)+x (e-2 f+4 g-8 h+16 i)+\frac {1}{2} x^2 (f-2 g+4 h-8 i)+\frac {1}{3} x^3 (g-2 h+4 i)+\frac {1}{4} x^4 (h-2 i)+\frac {i x^5}{5} \]

[Out]

(e-2*f+4*g-8*h+16*i)*x+1/2*(f-2*g+4*h-8*i)*x^2+1/3*(g-2*h+4*i)*x^3+1/4*(h-2*i)*x^4+1/5*i*x^5+(d-2*e+4*f-8*g+16
*h-32*i)*ln(2+x)

________________________________________________________________________________________

Rubi [A]  time = 0.15, antiderivative size = 92, normalized size of antiderivative = 1.00, number of steps used = 3, number of rules used = 2, integrand size = 51, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.039, Rules used = {1586, 1850} \[ \log (x+2) (d-2 e+4 f-8 g+16 h-32 i)+x (e-2 f+4 g-8 h+16 i)+\frac {1}{2} x^2 (f-2 g+4 h-8 i)+\frac {1}{3} x^3 (g-2 h+4 i)+\frac {1}{4} x^4 (h-2 i)+\frac {i x^5}{5} \]

Antiderivative was successfully verified.

[In]

Int[((2 - x - 2*x^2 + x^3)*(d + e*x + f*x^2 + g*x^3 + h*x^4 + i*x^5))/(4 - 5*x^2 + x^4),x]

[Out]

(e - 2*f + 4*g - 8*h + 16*i)*x + ((f - 2*g + 4*h - 8*i)*x^2)/2 + ((g - 2*h + 4*i)*x^3)/3 + ((h - 2*i)*x^4)/4 +
 (i*x^5)/5 + (d - 2*e + 4*f - 8*g + 16*h - 32*i)*Log[2 + x]

Rule 1586

Int[(u_.)*(Px_)^(p_.)*(Qx_)^(q_.), x_Symbol] :> Int[u*PolynomialQuotient[Px, Qx, x]^p*Qx^(p + q), x] /; FreeQ[
q, x] && PolyQ[Px, x] && PolyQ[Qx, x] && EqQ[PolynomialRemainder[Px, Qx, x], 0] && IntegerQ[p] && LtQ[p*q, 0]

Rule 1850

Int[(Pq_)*((a_) + (b_.)*(x_)^(n_.))^(p_.), x_Symbol] :> Int[ExpandIntegrand[Pq*(a + b*x^n)^p, x], x] /; FreeQ[
{a, b, n}, x] && PolyQ[Pq, x] && (IGtQ[p, 0] || EqQ[n, 1])

Rubi steps

\begin {align*} \int \frac {\left (2-x-2 x^2+x^3\right ) \left (d+e x+f x^2+g x^3+h x^4+72 x^5\right )}{4-5 x^2+x^4} \, dx &=\int \frac {d+e x+f x^2+g x^3+h x^4+72 x^5}{2+x} \, dx\\ &=\int \left (1152 \left (1+\frac {e-2 f+4 g-8 h}{1152}\right )+(-576+f-2 g+4 h) x+(288+g-2 h) x^2+(-144+h) x^3+72 x^4+\frac {-2304+d-2 e+4 f-8 g+16 h}{2+x}\right ) \, dx\\ &=(1152+e-2 f+4 g-8 h) x-\frac {1}{2} (576-f+2 g-4 h) x^2+\frac {1}{3} (288+g-2 h) x^3-\frac {1}{4} (144-h) x^4+\frac {72 x^5}{5}-(2304-d+2 e-4 f+8 g-16 h) \log (2+x)\\ \end {align*}

________________________________________________________________________________________

Mathematica [A]  time = 0.03, size = 92, normalized size = 1.00 \[ \log (x+2) (d-2 e+4 f-8 g+16 h-32 i)+x (e-2 f+4 g-8 h+16 i)+\frac {1}{2} x^2 (f-2 g+4 h-8 i)+\frac {1}{3} x^3 (g-2 h+4 i)+\frac {1}{4} x^4 (h-2 i)+\frac {i x^5}{5} \]

Antiderivative was successfully verified.

[In]

Integrate[((2 - x - 2*x^2 + x^3)*(d + e*x + f*x^2 + g*x^3 + h*x^4 + i*x^5))/(4 - 5*x^2 + x^4),x]

[Out]

(e - 2*f + 4*g - 8*h + 16*i)*x + ((f - 2*g + 4*h - 8*i)*x^2)/2 + ((g - 2*h + 4*i)*x^3)/3 + ((h - 2*i)*x^4)/4 +
 (i*x^5)/5 + (d - 2*e + 4*f - 8*g + 16*h - 32*i)*Log[2 + x]

________________________________________________________________________________________

fricas [A]  time = 0.90, size = 84, normalized size = 0.91 \[ \frac {1}{5} \, i x^{5} + \frac {1}{4} \, {\left (h - 2 \, i\right )} x^{4} + \frac {1}{3} \, {\left (g - 2 \, h + 4 \, i\right )} x^{3} + \frac {1}{2} \, {\left (f - 2 \, g + 4 \, h - 8 \, i\right )} x^{2} + {\left (e - 2 \, f + 4 \, g - 8 \, h + 16 \, i\right )} x + {\left (d - 2 \, e + 4 \, f - 8 \, g + 16 \, h - 32 \, i\right )} \log \left (x + 2\right ) \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((x^3-2*x^2-x+2)*(i*x^5+h*x^4+g*x^3+f*x^2+e*x+d)/(x^4-5*x^2+4),x, algorithm="fricas")

[Out]

1/5*i*x^5 + 1/4*(h - 2*i)*x^4 + 1/3*(g - 2*h + 4*i)*x^3 + 1/2*(f - 2*g + 4*h - 8*i)*x^2 + (e - 2*f + 4*g - 8*h
 + 16*i)*x + (d - 2*e + 4*f - 8*g + 16*h - 32*i)*log(x + 2)

________________________________________________________________________________________

giac [A]  time = 0.27, size = 105, normalized size = 1.14 \[ \frac {1}{5} \, i x^{5} + \frac {1}{4} \, h x^{4} - \frac {1}{2} \, i x^{4} + \frac {1}{3} \, g x^{3} - \frac {2}{3} \, h x^{3} + \frac {4}{3} \, i x^{3} + \frac {1}{2} \, f x^{2} - g x^{2} + 2 \, h x^{2} - 4 \, i x^{2} - 2 \, f x + 4 \, g x - 8 \, h x + 16 \, i x + x e + {\left (d + 4 \, f - 8 \, g + 16 \, h - 32 \, i - 2 \, e\right )} \log \left ({\left | x + 2 \right |}\right ) \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((x^3-2*x^2-x+2)*(i*x^5+h*x^4+g*x^3+f*x^2+e*x+d)/(x^4-5*x^2+4),x, algorithm="giac")

[Out]

1/5*i*x^5 + 1/4*h*x^4 - 1/2*i*x^4 + 1/3*g*x^3 - 2/3*h*x^3 + 4/3*i*x^3 + 1/2*f*x^2 - g*x^2 + 2*h*x^2 - 4*i*x^2
- 2*f*x + 4*g*x - 8*h*x + 16*i*x + x*e + (d + 4*f - 8*g + 16*h - 32*i - 2*e)*log(abs(x + 2))

________________________________________________________________________________________

maple [A]  time = 0.00, size = 122, normalized size = 1.33 \[ \frac {i \,x^{5}}{5}+\frac {h \,x^{4}}{4}-\frac {i \,x^{4}}{2}+\frac {g \,x^{3}}{3}-\frac {2 h \,x^{3}}{3}+\frac {4 i \,x^{3}}{3}+\frac {f \,x^{2}}{2}-g \,x^{2}+2 h \,x^{2}-4 i \,x^{2}+d \ln \left (x +2\right )+e x -2 e \ln \left (x +2\right )-2 f x +4 f \ln \left (x +2\right )+4 g x -8 g \ln \left (x +2\right )-8 h x +16 h \ln \left (x +2\right )+16 i x -32 i \ln \left (x +2\right ) \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

int((x^3-2*x^2-x+2)*(i*x^5+h*x^4+g*x^3+f*x^2+e*x+d)/(x^4-5*x^2+4),x)

[Out]

1/5*i*x^5+1/4*h*x^4-1/2*i*x^4+1/3*g*x^3-2/3*h*x^3+4/3*i*x^3+1/2*f*x^2-g*x^2+2*h*x^2-4*i*x^2+e*x-2*f*x+4*g*x-8*
h*x+16*i*x+d*ln(x+2)-2*e*ln(x+2)+4*f*ln(x+2)-8*g*ln(x+2)+16*h*ln(x+2)-32*i*ln(x+2)

________________________________________________________________________________________

maxima [A]  time = 0.46, size = 84, normalized size = 0.91 \[ \frac {1}{5} \, i x^{5} + \frac {1}{4} \, {\left (h - 2 \, i\right )} x^{4} + \frac {1}{3} \, {\left (g - 2 \, h + 4 \, i\right )} x^{3} + \frac {1}{2} \, {\left (f - 2 \, g + 4 \, h - 8 \, i\right )} x^{2} + {\left (e - 2 \, f + 4 \, g - 8 \, h + 16 \, i\right )} x + {\left (d - 2 \, e + 4 \, f - 8 \, g + 16 \, h - 32 \, i\right )} \log \left (x + 2\right ) \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((x^3-2*x^2-x+2)*(i*x^5+h*x^4+g*x^3+f*x^2+e*x+d)/(x^4-5*x^2+4),x, algorithm="maxima")

[Out]

1/5*i*x^5 + 1/4*(h - 2*i)*x^4 + 1/3*(g - 2*h + 4*i)*x^3 + 1/2*(f - 2*g + 4*h - 8*i)*x^2 + (e - 2*f + 4*g - 8*h
 + 16*i)*x + (d - 2*e + 4*f - 8*g + 16*h - 32*i)*log(x + 2)

________________________________________________________________________________________

mupad [B]  time = 0.04, size = 87, normalized size = 0.95 \[ x^4\,\left (\frac {h}{4}-\frac {i}{2}\right )+\ln \left (x+2\right )\,\left (d-2\,e+4\,f-8\,g+16\,h-32\,i\right )+\frac {i\,x^5}{5}+x^2\,\left (\frac {f}{2}-g+2\,h-4\,i\right )+x\,\left (e-2\,f+4\,g-8\,h+16\,i\right )+x^3\,\left (\frac {g}{3}-\frac {2\,h}{3}+\frac {4\,i}{3}\right ) \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(-((x + 2*x^2 - x^3 - 2)*(d + e*x + f*x^2 + g*x^3 + h*x^4 + i*x^5))/(x^4 - 5*x^2 + 4),x)

[Out]

x^4*(h/4 - i/2) + log(x + 2)*(d - 2*e + 4*f - 8*g + 16*h - 32*i) + (i*x^5)/5 + x^2*(f/2 - g + 2*h - 4*i) + x*(
e - 2*f + 4*g - 8*h + 16*i) + x^3*(g/3 - (2*h)/3 + (4*i)/3)

________________________________________________________________________________________

sympy [A]  time = 0.25, size = 88, normalized size = 0.96 \[ \frac {i x^{5}}{5} + x^{4} \left (\frac {h}{4} - \frac {i}{2}\right ) + x^{3} \left (\frac {g}{3} - \frac {2 h}{3} + \frac {4 i}{3}\right ) + x^{2} \left (\frac {f}{2} - g + 2 h - 4 i\right ) + x \left (e - 2 f + 4 g - 8 h + 16 i\right ) + \left (d - 2 e + 4 f - 8 g + 16 h - 32 i\right ) \log {\left (x + 2 \right )} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((x**3-2*x**2-x+2)*(i*x**5+h*x**4+g*x**3+f*x**2+e*x+d)/(x**4-5*x**2+4),x)

[Out]

i*x**5/5 + x**4*(h/4 - i/2) + x**3*(g/3 - 2*h/3 + 4*i/3) + x**2*(f/2 - g + 2*h - 4*i) + x*(e - 2*f + 4*g - 8*h
 + 16*i) + (d - 2*e + 4*f - 8*g + 16*h - 32*i)*log(x + 2)

________________________________________________________________________________________